package com.csyaonie.android.storage;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.csyaonie.android.LifeCycleActivity;
import com.csyaonie.android.R;

public class StorageActivity extends AppCompatActivity {

    private Button bt_preferences;
    private Button bt_file;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_storage);
        bt_preferences=findViewById(R.id.bt_preferences);
        bt_file=findViewById(R.id.bt_file);
        setListener();
    }

    public void setListener(){
        StorageActivity.Onclick onclick=new StorageActivity.Onclick();
        bt_preferences.setOnClickListener(onclick);
        bt_file.setOnClickListener(onclick);
    }

    public class Onclick implements View.OnClickListener {

        @Override
        public void onClick(View v) {
            Intent intent = null;
            switch (v.getId()) {
                case R.id.bt_preferences:
                    intent = new Intent(StorageActivity.this, SharedPreferencesActivity.class);
                    break;
                case R.id.bt_file:
                    intent = new Intent(StorageActivity.this, FileActivity.class);
                    break;
            }
            startActivity(intent);
        }
    }
}